$(function () {

    $('body').on('click','#updateUserInfo',function () {
        var userInfo = $('textarea[name="userInfo"]').val();

        if(userInfo.trim == null || userInfo.trim == ''){
            $.alert('请输入个性签名');
            return;
        }
        if(userInfo.trim().length>200){
            $.alert('个性签名字数不能大于200');
            return;
        }
        var params = {"userInfo":userInfo};
        params = JSON.stringify(params);
        $.ajax({
            url: baseloaction + '/mobile/uc/userInfo/updateUserInfo',
            type: 'post',
            dataType: 'json',
            data: params,
            async: false,
            contentType:'application/json;charset=utf-8',
            success: function (result) {
                if(result.success){
                    $.alert(result.message,function () {
                        window.location.href=baseloaction+'/mobile/uc/userInfo';
                    });
                }else {
                    $.toast(result.message);
                }
            }
        })
    })
});
